import Http from '@/http';

export function saveApi(params:any) {
    return params.id ? Http.post('school/update', params) : Http.post('school/add', params)
}

export function pageApi(params:any) {
    return Http.post('school/page', params)
}

export function deleteApi(id) {
    return Http.post('school/delete', {id: id})
}

export async function schoolOptionsApi() {
    const r = await Http.get('school/options')
    return r.data
}


export function restpwdApi(id:number, password:string) {
    return Http.put('school/resetpwd', { id, password })
}

export async function querySchoolApi(name:string) {
    const r = await Http.get<any[]>('school/query?name=' + name)
    return r.data
}